export async function productVerification(ctx, next) {
  try {
    ctx.verifyParams({
      name: { type: "string", required: true },
      price: {
        type: "number",
        required: true,
      },
      desc: { type: "string", required: true },
      inventory: { type: "number", required: true },
      pic: { type: "string", required: true },
    });
  } catch (error) {
    return ctx.app.emit(
      "error",
      {
        code: 10001,
        message: "商品信息验证失败",
        result: error,
      },
      ctx
    );
  }
  await next();
}
